<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Linux基础小结 | ShuangChenYue</title>
    <meta name="generator" content="VuePress 1.9.10">
    <link rel="icon" href="https://cdn.jsdelivr.net/gh/cmty256/imgs-blog@main/logo/白云.38zbldnhh180.jpg">
    <meta name="description" content="满招损，谦受益">
    <meta name="keywords" content="专注于Cpp语言的旅行者">
    
    <link rel="preload" href="/assets/css/0.styles.952d6952.css" as="style"><link rel="preload" href="/assets/js/app.67adcfd9.js" as="script"><link rel="preload" href="/assets/js/4.9aaa1650.js" as="script"><link rel="preload" href="/assets/js/1.5474518c.js" as="script"><link rel="preload" href="/assets/js/3.593d14fc.js" as="script"><link rel="preload" href="/assets/js/112.ffbdb3a4.js" as="script"><link rel="prefetch" href="/assets/js/10.3242746b.js"><link rel="prefetch" href="/assets/js/100.9224de43.js"><link rel="prefetch" href="/assets/js/101.f0d1b059.js"><link rel="prefetch" href="/assets/js/102.996bfc6d.js"><link rel="prefetch" href="/assets/js/103.9bfdbd6f.js"><link rel="prefetch" href="/assets/js/104.8613f283.js"><link rel="prefetch" href="/assets/js/105.aa6e809e.js"><link rel="prefetch" href="/assets/js/106.90192392.js"><link rel="prefetch" href="/assets/js/107.e82a40b7.js"><link rel="prefetch" href="/assets/js/108.994cd438.js"><link rel="prefetch" href="/assets/js/109.ec15acc2.js"><link rel="prefetch" href="/assets/js/11.c04b41c1.js"><link rel="prefetch" href="/assets/js/110.c32d8576.js"><link rel="prefetch" href="/assets/js/111.453b5d50.js"><link rel="prefetch" href="/assets/js/113.12b8ad7d.js"><link rel="prefetch" href="/assets/js/114.899d2998.js"><link rel="prefetch" href="/assets/js/115.b7ad9576.js"><link rel="prefetch" href="/assets/js/116.a8394748.js"><link rel="prefetch" href="/assets/js/117.0edfe25b.js"><link rel="prefetch" href="/assets/js/118.9161b1fe.js"><link rel="prefetch" href="/assets/js/119.be59e21b.js"><link rel="prefetch" href="/assets/js/12.41437bf6.js"><link rel="prefetch" href="/assets/js/120.bcf439fb.js"><link rel="prefetch" href="/assets/js/121.c3d251b8.js"><link rel="prefetch" href="/assets/js/122.62b1caba.js"><link rel="prefetch" href="/assets/js/123.787c2ab0.js"><link rel="prefetch" href="/assets/js/124.a880746f.js"><link rel="prefetch" href="/assets/js/125.d8edfe7b.js"><link rel="prefetch" href="/assets/js/126.4ff01546.js"><link rel="prefetch" href="/assets/js/127.9416d1ff.js"><link rel="prefetch" href="/assets/js/128.01a4a7a0.js"><link rel="prefetch" href="/assets/js/129.76876665.js"><link rel="prefetch" href="/assets/js/13.922328e9.js"><link rel="prefetch" href="/assets/js/130.7f631dd9.js"><link rel="prefetch" href="/assets/js/131.c9e0fde9.js"><link rel="prefetch" href="/assets/js/132.1c04cde5.js"><link rel="prefetch" href="/assets/js/133.e8f381cd.js"><link rel="prefetch" href="/assets/js/134.03d19f8b.js"><link rel="prefetch" href="/assets/js/135.44607494.js"><link rel="prefetch" href="/assets/js/136.6a1eb3c9.js"><link rel="prefetch" href="/assets/js/137.27898fd1.js"><link rel="prefetch" href="/assets/js/138.5bc0cf54.js"><link rel="prefetch" href="/assets/js/139.c2d1addc.js"><link rel="prefetch" href="/assets/js/14.e54d7526.js"><link rel="prefetch" href="/assets/js/140.052ec8e4.js"><link rel="prefetch" href="/assets/js/141.131abb5a.js"><link rel="prefetch" href="/assets/js/142.6ba6c07b.js"><link rel="prefetch" href="/assets/js/143.5dd51d22.js"><link rel="prefetch" href="/assets/js/144.b45afca8.js"><link rel="prefetch" href="/assets/js/145.faa9fb04.js"><link rel="prefetch" href="/assets/js/146.b54c024d.js"><link rel="prefetch" href="/assets/js/147.a1223242.js"><link rel="prefetch" href="/assets/js/148.4767bcb2.js"><link rel="prefetch" href="/assets/js/149.b65ab046.js"><link rel="prefetch" href="/assets/js/15.7082a3da.js"><link rel="prefetch" href="/assets/js/150.9bd8c175.js"><link rel="prefetch" href="/assets/js/151.9f830e96.js"><link rel="prefetch" href="/assets/js/152.41cde7f0.js"><link rel="prefetch" href="/assets/js/153.f57d65e0.js"><link rel="prefetch" href="/assets/js/154.5d7c8d51.js"><link rel="prefetch" href="/assets/js/155.0ae99532.js"><link rel="prefetch" href="/assets/js/156.5a54e043.js"><link rel="prefetch" href="/assets/js/157.c25b5d40.js"><link rel="prefetch" href="/assets/js/158.aa025b46.js"><link rel="prefetch" href="/assets/js/159.47939d88.js"><link rel="prefetch" href="/assets/js/16.fc775b7b.js"><link rel="prefetch" href="/assets/js/160.f8624459.js"><link rel="prefetch" href="/assets/js/161.7a075dc2.js"><link rel="prefetch" href="/assets/js/162.1d48f266.js"><link rel="prefetch" href="/assets/js/163.5d68a99f.js"><link rel="prefetch" href="/assets/js/164.1262d0e5.js"><link rel="prefetch" href="/assets/js/165.2ccf0bdd.js"><link rel="prefetch" href="/assets/js/166.21ece4d9.js"><link rel="prefetch" href="/assets/js/167.bf8adb95.js"><link rel="prefetch" href="/assets/js/168.1cb8440d.js"><link rel="prefetch" href="/assets/js/169.1dd1e396.js"><link rel="prefetch" href="/assets/js/17.ecc7be70.js"><link rel="prefetch" href="/assets/js/170.c29ec18f.js"><link rel="prefetch" href="/assets/js/171.38820827.js"><link rel="prefetch" href="/assets/js/172.bbc8ffc6.js"><link rel="prefetch" href="/assets/js/173.470e21e7.js"><link rel="prefetch" href="/assets/js/174.3c2df318.js"><link rel="prefetch" href="/assets/js/175.d2690cdb.js"><link rel="prefetch" href="/assets/js/176.9ca64696.js"><link rel="prefetch" href="/assets/js/177.76f3271d.js"><link rel="prefetch" href="/assets/js/178.d7d9def2.js"><link rel="prefetch" href="/assets/js/179.b5644743.js"><link rel="prefetch" href="/assets/js/18.31fe7ecd.js"><link rel="prefetch" href="/assets/js/180.7592d5ef.js"><link rel="prefetch" href="/assets/js/181.5cb77d35.js"><link rel="prefetch" href="/assets/js/182.6fa5633c.js"><link rel="prefetch" href="/assets/js/183.b3a53d1b.js"><link rel="prefetch" href="/assets/js/184.3815c537.js"><link rel="prefetch" href="/assets/js/185.bcf4ab71.js"><link rel="prefetch" href="/assets/js/186.1cc02f6d.js"><link rel="prefetch" href="/assets/js/187.8b425fb7.js"><link rel="prefetch" href="/assets/js/188.44ccbd02.js"><link rel="prefetch" href="/assets/js/189.353b35e3.js"><link rel="prefetch" href="/assets/js/19.520992d5.js"><link rel="prefetch" href="/assets/js/190.c284595f.js"><link rel="prefetch" href="/assets/js/191.788ecc2d.js"><link rel="prefetch" href="/assets/js/192.712a164e.js"><link rel="prefetch" href="/assets/js/193.da58aba3.js"><link rel="prefetch" href="/assets/js/194.6b1b1f4d.js"><link rel="prefetch" href="/assets/js/195.c31d5c39.js"><link rel="prefetch" href="/assets/js/196.f6670c4d.js"><link rel="prefetch" href="/assets/js/197.5a1f50ab.js"><link rel="prefetch" href="/assets/js/2.ab565158.js"><link rel="prefetch" href="/assets/js/20.69e29cdc.js"><link rel="prefetch" href="/assets/js/21.2fd424ad.js"><link rel="prefetch" href="/assets/js/22.d4c0be54.js"><link rel="prefetch" href="/assets/js/23.4bb90ecc.js"><link rel="prefetch" href="/assets/js/24.c01be6b2.js"><link rel="prefetch" href="/assets/js/25.c8833687.js"><link rel="prefetch" href="/assets/js/26.8042b555.js"><link rel="prefetch" href="/assets/js/27.0d5fa4c0.js"><link rel="prefetch" href="/assets/js/28.f9735b8b.js"><link rel="prefetch" href="/assets/js/29.3af53626.js"><link rel="prefetch" href="/assets/js/30.5f1b56d1.js"><link rel="prefetch" href="/assets/js/31.544b2649.js"><link rel="prefetch" href="/assets/js/32.aa321988.js"><link rel="prefetch" href="/assets/js/33.6aba2c86.js"><link rel="prefetch" href="/assets/js/34.e1bbff24.js"><link rel="prefetch" href="/assets/js/35.233f76e0.js"><link rel="prefetch" href="/assets/js/36.cb773972.js"><link rel="prefetch" href="/assets/js/37.393d9c59.js"><link rel="prefetch" href="/assets/js/38.e2d530c5.js"><link rel="prefetch" href="/assets/js/39.acaf1cc0.js"><link rel="prefetch" href="/assets/js/40.358f731e.js"><link rel="prefetch" href="/assets/js/41.ded24b7e.js"><link rel="prefetch" href="/assets/js/42.b9f683c3.js"><link rel="prefetch" href="/assets/js/43.c8fb3e66.js"><link rel="prefetch" href="/assets/js/44.633142da.js"><link rel="prefetch" href="/assets/js/45.6095e772.js"><link rel="prefetch" href="/assets/js/46.421d8c7a.js"><link rel="prefetch" href="/assets/js/47.da50fe47.js"><link rel="prefetch" href="/assets/js/48.15ff5726.js"><link rel="prefetch" href="/assets/js/49.b662e624.js"><link rel="prefetch" href="/assets/js/5.c1b8a209.js"><link rel="prefetch" href="/assets/js/50.a8bc75df.js"><link rel="prefetch" href="/assets/js/51.51e36ae7.js"><link rel="prefetch" href="/assets/js/52.54cc6e51.js"><link rel="prefetch" href="/assets/js/53.4173561d.js"><link rel="prefetch" href="/assets/js/54.7cab8416.js"><link rel="prefetch" href="/assets/js/55.3d7317d3.js"><link rel="prefetch" href="/assets/js/56.3c22255b.js"><link rel="prefetch" href="/assets/js/57.18e46e30.js"><link rel="prefetch" href="/assets/js/58.aad57f31.js"><link rel="prefetch" href="/assets/js/59.7897f6a7.js"><link rel="prefetch" href="/assets/js/6.3131f88a.js"><link rel="prefetch" href="/assets/js/60.5cd0051a.js"><link rel="prefetch" href="/assets/js/61.d9606403.js"><link rel="prefetch" href="/assets/js/62.aede9df0.js"><link rel="prefetch" href="/assets/js/63.2c30e554.js"><link rel="prefetch" href="/assets/js/64.18228ab7.js"><link rel="prefetch" href="/assets/js/65.27cb3fba.js"><link rel="prefetch" href="/assets/js/66.2fa6c2dc.js"><link rel="prefetch" href="/assets/js/67.d274a8df.js"><link rel="prefetch" href="/assets/js/68.3069cfcf.js"><link rel="prefetch" href="/assets/js/69.4c28600f.js"><link rel="prefetch" href="/assets/js/7.89e6165d.js"><link rel="prefetch" href="/assets/js/70.4175440c.js"><link rel="prefetch" href="/assets/js/71.2ee6b435.js"><link rel="prefetch" href="/assets/js/72.c75e3bb8.js"><link rel="prefetch" href="/assets/js/73.6f8b8211.js"><link rel="prefetch" href="/assets/js/74.6c7720cf.js"><link rel="prefetch" href="/assets/js/75.cccfb229.js"><link rel="prefetch" href="/assets/js/76.f022e5da.js"><link rel="prefetch" href="/assets/js/77.dab46206.js"><link rel="prefetch" href="/assets/js/78.ca574b2a.js"><link rel="prefetch" href="/assets/js/79.3d75e618.js"><link rel="prefetch" href="/assets/js/80.091749b1.js"><link rel="prefetch" href="/assets/js/81.14db0e21.js"><link rel="prefetch" href="/assets/js/82.8a2b1809.js"><link rel="prefetch" href="/assets/js/83.84a4b599.js"><link rel="prefetch" href="/assets/js/84.11d7c222.js"><link rel="prefetch" href="/assets/js/85.273d4388.js"><link rel="prefetch" href="/assets/js/86.fb40e20c.js"><link rel="prefetch" href="/assets/js/87.3316639e.js"><link rel="prefetch" href="/assets/js/88.dfc52200.js"><link rel="prefetch" href="/assets/js/89.8d615f6e.js"><link rel="prefetch" href="/assets/js/90.1d9f08bb.js"><link rel="prefetch" href="/assets/js/91.566813e7.js"><link rel="prefetch" href="/assets/js/92.d13c6f41.js"><link rel="prefetch" href="/assets/js/93.845c42a0.js"><link rel="prefetch" href="/assets/js/94.20a37b77.js"><link rel="prefetch" href="/assets/js/95.1a498005.js"><link rel="prefetch" href="/assets/js/96.39fa7f4b.js"><link rel="prefetch" href="/assets/js/97.50f7170e.js"><link rel="prefetch" href="/assets/js/98.dd2e15d6.js"><link rel="prefetch" href="/assets/js/99.ef7ea06a.js"><link rel="prefetch" href="/assets/js/vendors~docsearch.ae6b1de9.js">
    <link rel="stylesheet" href="/assets/css/0.styles.952d6952.css">
  </head>
  <body class="theme-mode-light">
    <div id="app" data-server-rendered="true"><div class="theme-container sidebar-open have-rightmenu"><header class="navbar blur"><div title="目录" class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><img src="https://cdn.jsdelivr.net/gh/cmty256/imgs-blog@main/logo/白云.38zbldnhh180.jpg" alt="ShuangChenYue" class="logo"> <span class="site-name can-hide">ShuangChenYue</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link">首页</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="CPP语言" class="dropdown-title"><!----> <span class="title" style="display:;">CPP语言</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/c5bdd8/" class="nav-link">Cpp之旅</a></li><li class="dropdown-item"><!----> <a href="/pages/279e62/" class="nav-link">Cpp专栏</a></li><li class="dropdown-item"><!----> <a href="/pages/801755/" class="nav-link">Effective_CPP</a></li><li class="dropdown-item"><!----> <a href="/pages/6b2468/" class="nav-link">muduo网络库</a></li><li class="dropdown-item"><!----> <a href="/pages/5f8c9f/" class="nav-link">Unix环境高级编程</a></li><li class="dropdown-item"><!----> <a href="/pages/3f1d21/" class="nav-link">Cpp提高编程</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="计算机基础" class="dropdown-title"><!----> <span class="title" style="display:;">计算机基础</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/7b1cb2/" class="nav-link">计算机网络</a></li><li class="dropdown-item"><!----> <a href="/pages/6048a8/" class="nav-link">操作系统</a></li><li class="dropdown-item"><!----> <a href="/pages/3b34ba/" class="nav-link">数据结构</a></li><li class="dropdown-item"><!----> <a href="/pages/412fe7/" aria-current="page" class="nav-link router-link-exact-active router-link-active">Linux</a></li><li class="dropdown-item"><!----> <a href="/pages/2dcfa1/" class="nav-link">算法</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="数据库" class="dropdown-title"><!----> <span class="title" style="display:;">数据库</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/efa3f2/" class="nav-link">基础篇</a></li><li class="dropdown-item"><!----> <a href="/pages/ccc445/" class="nav-link">MySql</a></li><li class="dropdown-item"><!----> <a href="/pages/54616e/" class="nav-link">Redis</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="嵌入式软件开发" class="dropdown-title"><!----> <span class="title" style="display:;">嵌入式软件开发</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/d142c2/" class="nav-link">电子嵌入式通信协议</a></li><li class="dropdown-item"><!----> <a href="/pages/4c6bf3/" class="nav-link">深入浅出SSD</a></li><li class="dropdown-item"><!----> <a href="/pages/d3f36a/" class="nav-link">文件系统</a></li><li class="dropdown-item"><!----> <a href="/pages/e0cca7/" class="nav-link">汇编语言</a></li><li class="dropdown-item"><!----> <a href="/pages/fab2d7/" class="nav-link">STM32</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="开发日常" class="dropdown-title"><!----> <span class="title" style="display:;">开发日常</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/e472d1/" class="nav-link">随笔（持续更新）</a></li><li class="dropdown-item"><!----> <a href="/pages/71f6ae/" class="nav-link">Git知识总结</a></li><li class="dropdown-item"><!----> <a href="/pages/db6fb8/" class="nav-link">Git备忘清单</a></li><li class="dropdown-item"><!----> <a href="/pages/e1081f/" class="nav-link">Git 创建删除远程分支</a></li><li class="dropdown-item"><!----> <a href="/pages/777b8a/" class="nav-link">nvm使用小结</a></li><li class="dropdown-item"><!----> <a href="/pages/ee770e/" class="nav-link">虚拟机固定 IP 地址</a></li><li class="dropdown-item"><!----> <a href="/pages/1ab9a6/" class="nav-link">Shell 脚本学习笔记</a></li><li class="dropdown-item"><!----> <a href="/pages/411aa4/" class="nav-link">VScode 插件 CodeGeeX 使用教程</a></li><li class="dropdown-item"><!----> <a href="/pages/0d525d/" class="nav-link">KylinV10 将项目上传至 Github教程</a></li><li class="dropdown-item"><!----> <a href="/pages/907786/" class="nav-link">KylinV10 安装 MySQL 教程（可防踩雷）</a></li><li class="dropdown-item"><!----> <a href="/pages/a2d21e/" class="nav-link">kylinV10-SP1 安装 QT</a></li><li class="dropdown-item"><!----> <a href="/pages/b561cf/" class="nav-link">高并发内存池</a></li><li class="dropdown-item"><!----> <a href="/pages/6ab6d1/" class="nav-link">USBGUARD 项目编译环境配置</a></li><li class="dropdown-item"><!----> <a href="/pages/883f02/" class="nav-link">Power_Destory 项目</a></li><li class="dropdown-item"><!----> <a href="/pages/479472/" class="nav-link">U 盘清除工具编译教程</a></li><li class="dropdown-item"><!----> <a href="/pages/9c4241/" class="nav-link">个人博客代码推送教程</a></li><li class="dropdown-item"><!----> <a href="/pages/3ad765/" class="nav-link">SVN Trunk Branches的Merge操作</a></li><li class="dropdown-item"><!----> <a href="/pages/0c0ca8/" class="nav-link">如何高效阅读嵌入式项目代码</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="前端学习" class="dropdown-title"><!----> <span class="title" style="display:;">前端学习</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/99897f/" class="nav-link">HTML与CSS</a></li><li class="dropdown-item"><!----> <a href="/pages/51542d/" class="nav-link">JS学习</a></li><li class="dropdown-item"><!----> <a href="/pages/803f9d/" class="nav-link">Vue3入门</a></li><li class="dropdown-item"><!----> <a href="/pages/ca4cfb/" class="nav-link">Vue3进阶</a></li><li class="dropdown-item"><!----> <a href="/pages/50e8d3/" class="nav-link">黑马Vue3</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="MFC" class="dropdown-title"><!----> <span class="title" style="display:;">MFC</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/a4b108/" class="nav-link">MFC编程随记</a></li><li class="dropdown-item"><!----> <a href="/pages/41acbd/" class="nav-link">MFC实现ini配置文件的读取</a></li><li class="dropdown-item"><!----> <a href="/pages/951a7a/" class="nav-link">MFC实现点击列表头排序</a></li><li class="dropdown-item"><!----> <a href="/pages/a8598f/" class="nav-link">贴图法美化Button按钮</a></li><li class="dropdown-item"><!----> <a href="/pages/054516/" class="nav-link">MFC使用细节</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="闪存" class="dropdown-title"><!----> <span class="title" style="display:;">闪存</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/b925b8/" class="nav-link">如何高效阅读嵌入式项目代码</a></li><li class="dropdown-item"><!----> <a href="/pages/28ec23/" class="nav-link">NAND Flash</a></li><li class="dropdown-item"><!----> <a href="/pages/62bf40/" class="nav-link">ARM 处理器</a></li><li class="dropdown-item"><!----> <a href="/pages/1a9374/" class="nav-link">嵌入式基础知识-存储器</a></li><li class="dropdown-item"><!----> <a href="/pages/aac5e3/" class="nav-link">闪存存储和制造技术概述</a></li><li class="dropdown-item"><!----> <a href="/pages/8f6056/" class="nav-link">芯片IO驱动力</a></li><li class="dropdown-item"><!----> <a href="/pages/d146b8/" class="nav-link">主流先进封装技术介绍</a></li><li class="dropdown-item"><!----> <a href="/pages/16f0ba/" class="nav-link">NAND Flash基础</a></li><li class="dropdown-item"><!----> <a href="/pages/90d8d0/" class="nav-link">基于PA算法的FTL引导</a></li><li class="dropdown-item"><!----> <a href="/pages/eb672b/" class="nav-link">SD逻辑擦除和物理擦除</a></li><li class="dropdown-item"><!----> <a href="/pages/747121/" class="nav-link">NAND Flash的SDR、ONFI、DDR接口</a></li><li class="dropdown-item"><!----> <a href="/pages/1eb351/" class="nav-link">【详解】Nand Flash必看知识</a></li><li class="dropdown-item"><!----> <a href="/pages/d2512a/" class="nav-link">【两万字详解】Nand Flash必看知识</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="面经" class="dropdown-title"><!----> <span class="title" style="display:;">面经</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/d69946/" class="nav-link">虎牙C++技术面经</a></li><li class="dropdown-item"><!----> <a href="/pages/29251d/" class="nav-link">金山一面复习</a></li><li class="dropdown-item"><!----> <a href="/pages/c7c01f/" class="nav-link">完美世界秋招 C++ 游戏开发面经(Cpp部分)</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="其它" class="dropdown-title"><!----> <span class="title" style="display:;">其它</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/fa256e/" class="nav-link">博客搭建</a></li><li class="dropdown-item"><!----> <a href="/pages/335531/" class="nav-link">网站收藏箱</a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <div class="sidebar-hover-trigger"></div> <aside class="sidebar" style="display:none;"><!----> <nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link">首页</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="CPP语言" class="dropdown-title"><!----> <span class="title" style="display:;">CPP语言</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/c5bdd8/" class="nav-link">Cpp之旅</a></li><li class="dropdown-item"><!----> <a href="/pages/279e62/" class="nav-link">Cpp专栏</a></li><li class="dropdown-item"><!----> <a href="/pages/801755/" class="nav-link">Effective_CPP</a></li><li class="dropdown-item"><!----> <a href="/pages/6b2468/" class="nav-link">muduo网络库</a></li><li class="dropdown-item"><!----> <a href="/pages/5f8c9f/" class="nav-link">Unix环境高级编程</a></li><li class="dropdown-item"><!----> <a href="/pages/3f1d21/" class="nav-link">Cpp提高编程</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="计算机基础" class="dropdown-title"><!----> <span class="title" style="display:;">计算机基础</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/7b1cb2/" class="nav-link">计算机网络</a></li><li class="dropdown-item"><!----> <a href="/pages/6048a8/" class="nav-link">操作系统</a></li><li class="dropdown-item"><!----> <a href="/pages/3b34ba/" class="nav-link">数据结构</a></li><li class="dropdown-item"><!----> <a href="/pages/412fe7/" aria-current="page" class="nav-link router-link-exact-active router-link-active">Linux</a></li><li class="dropdown-item"><!----> <a href="/pages/2dcfa1/" class="nav-link">算法</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="数据库" class="dropdown-title"><!----> <span class="title" style="display:;">数据库</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/efa3f2/" class="nav-link">基础篇</a></li><li class="dropdown-item"><!----> <a href="/pages/ccc445/" class="nav-link">MySql</a></li><li class="dropdown-item"><!----> <a href="/pages/54616e/" class="nav-link">Redis</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="嵌入式软件开发" class="dropdown-title"><!----> <span class="title" style="display:;">嵌入式软件开发</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/d142c2/" class="nav-link">电子嵌入式通信协议</a></li><li class="dropdown-item"><!----> <a href="/pages/4c6bf3/" class="nav-link">深入浅出SSD</a></li><li class="dropdown-item"><!----> <a href="/pages/d3f36a/" class="nav-link">文件系统</a></li><li class="dropdown-item"><!----> <a href="/pages/e0cca7/" class="nav-link">汇编语言</a></li><li class="dropdown-item"><!----> <a href="/pages/fab2d7/" class="nav-link">STM32</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="开发日常" class="dropdown-title"><!----> <span class="title" style="display:;">开发日常</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/e472d1/" class="nav-link">随笔（持续更新）</a></li><li class="dropdown-item"><!----> <a href="/pages/71f6ae/" class="nav-link">Git知识总结</a></li><li class="dropdown-item"><!----> <a href="/pages/db6fb8/" class="nav-link">Git备忘清单</a></li><li class="dropdown-item"><!----> <a href="/pages/e1081f/" class="nav-link">Git 创建删除远程分支</a></li><li class="dropdown-item"><!----> <a href="/pages/777b8a/" class="nav-link">nvm使用小结</a></li><li class="dropdown-item"><!----> <a href="/pages/ee770e/" class="nav-link">虚拟机固定 IP 地址</a></li><li class="dropdown-item"><!----> <a href="/pages/1ab9a6/" class="nav-link">Shell 脚本学习笔记</a></li><li class="dropdown-item"><!----> <a href="/pages/411aa4/" class="nav-link">VScode 插件 CodeGeeX 使用教程</a></li><li class="dropdown-item"><!----> <a href="/pages/0d525d/" class="nav-link">KylinV10 将项目上传至 Github教程</a></li><li class="dropdown-item"><!----> <a href="/pages/907786/" class="nav-link">KylinV10 安装 MySQL 教程（可防踩雷）</a></li><li class="dropdown-item"><!----> <a href="/pages/a2d21e/" class="nav-link">kylinV10-SP1 安装 QT</a></li><li class="dropdown-item"><!----> <a href="/pages/b561cf/" class="nav-link">高并发内存池</a></li><li class="dropdown-item"><!----> <a href="/pages/6ab6d1/" class="nav-link">USBGUARD 项目编译环境配置</a></li><li class="dropdown-item"><!----> <a href="/pages/883f02/" class="nav-link">Power_Destory 项目</a></li><li class="dropdown-item"><!----> <a href="/pages/479472/" class="nav-link">U 盘清除工具编译教程</a></li><li class="dropdown-item"><!----> <a href="/pages/9c4241/" class="nav-link">个人博客代码推送教程</a></li><li class="dropdown-item"><!----> <a href="/pages/3ad765/" class="nav-link">SVN Trunk Branches的Merge操作</a></li><li class="dropdown-item"><!----> <a href="/pages/0c0ca8/" class="nav-link">如何高效阅读嵌入式项目代码</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="前端学习" class="dropdown-title"><!----> <span class="title" style="display:;">前端学习</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/99897f/" class="nav-link">HTML与CSS</a></li><li class="dropdown-item"><!----> <a href="/pages/51542d/" class="nav-link">JS学习</a></li><li class="dropdown-item"><!----> <a href="/pages/803f9d/" class="nav-link">Vue3入门</a></li><li class="dropdown-item"><!----> <a href="/pages/ca4cfb/" class="nav-link">Vue3进阶</a></li><li class="dropdown-item"><!----> <a href="/pages/50e8d3/" class="nav-link">黑马Vue3</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="MFC" class="dropdown-title"><!----> <span class="title" style="display:;">MFC</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/a4b108/" class="nav-link">MFC编程随记</a></li><li class="dropdown-item"><!----> <a href="/pages/41acbd/" class="nav-link">MFC实现ini配置文件的读取</a></li><li class="dropdown-item"><!----> <a href="/pages/951a7a/" class="nav-link">MFC实现点击列表头排序</a></li><li class="dropdown-item"><!----> <a href="/pages/a8598f/" class="nav-link">贴图法美化Button按钮</a></li><li class="dropdown-item"><!----> <a href="/pages/054516/" class="nav-link">MFC使用细节</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="闪存" class="dropdown-title"><!----> <span class="title" style="display:;">闪存</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/b925b8/" class="nav-link">如何高效阅读嵌入式项目代码</a></li><li class="dropdown-item"><!----> <a href="/pages/28ec23/" class="nav-link">NAND Flash</a></li><li class="dropdown-item"><!----> <a href="/pages/62bf40/" class="nav-link">ARM 处理器</a></li><li class="dropdown-item"><!----> <a href="/pages/1a9374/" class="nav-link">嵌入式基础知识-存储器</a></li><li class="dropdown-item"><!----> <a href="/pages/aac5e3/" class="nav-link">闪存存储和制造技术概述</a></li><li class="dropdown-item"><!----> <a href="/pages/8f6056/" class="nav-link">芯片IO驱动力</a></li><li class="dropdown-item"><!----> <a href="/pages/d146b8/" class="nav-link">主流先进封装技术介绍</a></li><li class="dropdown-item"><!----> <a href="/pages/16f0ba/" class="nav-link">NAND Flash基础</a></li><li class="dropdown-item"><!----> <a href="/pages/90d8d0/" class="nav-link">基于PA算法的FTL引导</a></li><li class="dropdown-item"><!----> <a href="/pages/eb672b/" class="nav-link">SD逻辑擦除和物理擦除</a></li><li class="dropdown-item"><!----> <a href="/pages/747121/" class="nav-link">NAND Flash的SDR、ONFI、DDR接口</a></li><li class="dropdown-item"><!----> <a href="/pages/1eb351/" class="nav-link">【详解】Nand Flash必看知识</a></li><li class="dropdown-item"><!----> <a href="/pages/d2512a/" class="nav-link">【两万字详解】Nand Flash必看知识</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="面经" class="dropdown-title"><!----> <span class="title" style="display:;">面经</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/d69946/" class="nav-link">虎牙C++技术面经</a></li><li class="dropdown-item"><!----> <a href="/pages/29251d/" class="nav-link">金山一面复习</a></li><li class="dropdown-item"><!----> <a href="/pages/c7c01f/" class="nav-link">完美世界秋招 C++ 游戏开发面经(Cpp部分)</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="其它" class="dropdown-title"><!----> <span class="title" style="display:;">其它</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/pages/fa256e/" class="nav-link">博客搭建</a></li><li class="dropdown-item"><!----> <a href="/pages/335531/" class="nav-link">网站收藏箱</a></li></ul></div></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>网络</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>操作系统</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>数据结构</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>算法</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>Linux</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/pages/412fe7/" aria-current="page" class="active sidebar-link">Linux基础小结</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level2"><a href="/pages/412fe7/#常见目录说明" class="sidebar-link">常见目录说明</a></li><li class="sidebar-sub-header level2"><a href="/pages/412fe7/#linux-常用指令" class="sidebar-link">Linux 常用指令</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level3"><a href="/pages/412fe7/#文件和目录操作" class="sidebar-link">文件和目录操作</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#ls-指令" class="sidebar-link">ls 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#cd-指令" class="sidebar-link">cd 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#mkdir-指令" class="sidebar-link">mkdir 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#touch-指令" class="sidebar-link">touch 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#cp-指令" class="sidebar-link">cp 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#mv-指令" class="sidebar-link">mv 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#rm-指令" class="sidebar-link">rm 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#cat-指令" class="sidebar-link">cat 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#pwd-指令" class="sidebar-link">pwd 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#chmod-指令" class="sidebar-link">chmod 指令</a></li><li class="sidebar-sub-header level3"><a href="/pages/412fe7/#系统信息和进程管理" class="sidebar-link">系统信息和进程管理</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#uname-指令" class="sidebar-link">uname 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#top-指令" class="sidebar-link">top 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#ps-指令" class="sidebar-link">ps 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#kill-指令" class="sidebar-link">kill 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#shutdown-指令" class="sidebar-link">shutdown 指令</a></li><li class="sidebar-sub-header level3"><a href="/pages/412fe7/#网络操作" class="sidebar-link">网络操作</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#ping-指令" class="sidebar-link">ping 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#ifconfig-指令" class="sidebar-link">ifconfig 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#netstat-指令" class="sidebar-link">netstat 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#wget-指令" class="sidebar-link">wget 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#scp-指令" class="sidebar-link">scp 指令</a></li><li class="sidebar-sub-header level3"><a href="/pages/412fe7/#压缩和解压缩" class="sidebar-link">压缩和解压缩</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#tar-指令" class="sidebar-link">tar 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#gzip-指令" class="sidebar-link">gzip 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#unzip-指令" class="sidebar-link">unzip 指令</a></li><li class="sidebar-sub-header level3"><a href="/pages/412fe7/#其他" class="sidebar-link">其他</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#man-指令" class="sidebar-link">man 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#history-指令" class="sidebar-link">history 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#grep-指令" class="sidebar-link">grep 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#输出重定向" class="sidebar-link">输出重定向</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#df-指令" class="sidebar-link">df 指令</a></li><li class="sidebar-sub-header level3"><a href="/pages/412fe7/#部署时可能会用到" class="sidebar-link">部署时可能会用到</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#free-h-指令" class="sidebar-link">free -h 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#nohup-指令" class="sidebar-link">nohup 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#jobs-指令" class="sidebar-link">jobs 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#netstat-ntlp-指令" class="sidebar-link">netstat -ntlp 指令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#jps-命令" class="sidebar-link">jps 命令</a></li><li class="sidebar-sub-header level4"><a href="/pages/412fe7/#df-指令-2" class="sidebar-link">df 指令</a></li></ul></li><li class="sidebar-sub-header level2"><a href="/pages/412fe7/#vim-常用指令" class="sidebar-link">vim 常用指令</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level3"><a href="/pages/412fe7/#移动光标" class="sidebar-link">移动光标</a></li><li class="sidebar-sub-header level3"><a href="/pages/412fe7/#编辑文本" class="sidebar-link">编辑文本</a></li><li class="sidebar-sub-header level3"><a href="/pages/412fe7/#搜索和替换" class="sidebar-link">搜索和替换</a></li><li class="sidebar-sub-header level3"><a href="/pages/412fe7/#保存和退出" class="sidebar-link">保存和退出</a></li></ul></li><li class="sidebar-sub-header level2"><a href="/pages/412fe7/#环境变量" class="sidebar-link">环境变量</a></li></ul></li></ul></section></li></ul> </aside> <div><main class="page"><div class="theme-vdoing-wrapper "><div class="articleInfo-wrap" data-v-06225672><div class="articleInfo" data-v-06225672><ul class="breadcrumbs" data-v-06225672><li data-v-06225672><a href="/" title="首页" class="iconfont icon-home router-link-active" data-v-06225672></a></li> <li data-v-06225672><span data-v-06225672>计算机基础</span></li><li data-v-06225672><span data-v-06225672>Linux</span></li></ul> <div class="info" data-v-06225672><div title="作者" class="author iconfont icon-touxiang" data-v-06225672><a href="javascript:;" data-v-06225672>霜晨月</a></div> <div title="创建时间" class="date iconfont icon-riqi" data-v-06225672><a href="javascript:;" data-v-06225672>2023-06-16</a></div> <!----></div></div></div> <!----> <div class="content-wrapper"><div class="right-menu-wrapper"><div class="right-menu-margin"><div class="right-menu-title">目录</div> <div class="right-menu-content"></div></div></div> <h1><img src="">Linux基础小结<!----></h1> <!----> <div class="theme-vdoing-content content__default"><h1 id="linux"><a href="#linux" class="header-anchor">#</a> Linux</h1> <h2 id="常见目录说明"><a href="#常见目录说明" class="header-anchor">#</a> 常见目录说明</h2> <ul><li>/bin：存放<strong>二进制可执行文件</strong>(ls、cat、mkdir 等)，<strong>常用命令一般都在这里</strong>；</li> <li>/sbin: 存放二进制可执行文件，只有 root 才能访问。这里存放的是系统管理员使用的系统级别的管理命令和程序。如 <code>ifconfig</code> 等；</li> <li>/etc：存放<strong>系统管理和配置文件</strong>；</li> <li>/root：超级用户（系统管理员）的主目录；</li> <li>/home：存放所有用户文件的根目录，是用户主目录的基点，比如用户 user 的主目录就是 /home/user，可以用 ~user 表示；</li> <li>/dev：用于存放<strong>设备文件</strong>；</li> <li>/usr：用于存放<strong>系统应用程序</strong>；</li> <li>/lib 和/lib64：存放着<strong>和系统运行相关的库文件</strong>；</li> <li>/tmp：用于存放各种临时文件，是公用的临时文件存储点；</li> <li>/var：用于存放运行时需要改变数据的文件，也是某些大文件的溢出区，比方说各种服务的<strong>日志文件</strong>（系统启动日志等）等；</li> <li>/opt：额外安装的可选应用程序包所放置的位置。一般情况下，我们可以把 tomcat 等都安装到这里；</li> <li>/proc：虚拟文件系统目录，是系统内存的映射。可直接访问这个目录来获取系统信息；</li> <li>/mnt：系统管理员安装临时文件系统的安装点，系统提供这个目录是让用户临时挂载其他的文件系统；</li> <li>/boot：存放用于系统引导时使用的各种文件；</li> <li>/lost+found：这个目录平时是空的，系统非正常关机而留下“无家可归”的文件（windows 下叫什么.chk）就在这里。</li></ul> <h2 id="linux-常用指令"><a href="#linux-常用指令" class="header-anchor">#</a> Linux 常用指令</h2> <h3 id="文件和目录操作"><a href="#文件和目录操作" class="header-anchor">#</a> 文件和目录操作</h3> <h4 id="ls-指令"><a href="#ls-指令" class="header-anchor">#</a> ls 指令</h4> <p>作用：列出当前工作目录下的所有文件/文件夹的名称</p> <p>用法：<code>ls [选项] [目录]</code></p> <p>ls -l 路径（<code>ll</code>）：以详细列表的形式展示指定路径下的所有文件/文件夹名称</p> <h4 id="cd-指令"><a href="#cd-指令" class="header-anchor">#</a> cd 指令</h4> <p>作用：改变目录，进入用户输入的目录</p> <p>用法：<code>cd [目录]</code></p> <p>示例：切换到 <code>/usr/local</code> 目录</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token builtin class-name">cd</span> /usr/local
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="mkdir-指令"><a href="#mkdir-指令" class="header-anchor">#</a> mkdir 指令</h4> <p>作用: 创建目录</p> <p>用法：<code>mkdir [选项] 目录</code></p> <p><code>mkdir -p</code> + <code>路径</code>：当一次性创建多层不存在的目录的时候，添加 <code>-p</code> 参数</p> <h4 id="touch-指令"><a href="#touch-指令" class="header-anchor">#</a> touch 指令</h4> <p>作用：创建文件</p> <p>示例：在当前目录中创建一个名为 <code>test.txt</code> 的空文件</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">touch</span> ./test.txt
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="cp-指令"><a href="#cp-指令" class="header-anchor">#</a> cp 指令</h4> <p>作用：复制文件或目录</p> <p>用法：<code>cp [选项] 被复制的文档路径 文档被复制到的路径</code></p> <p>示例：</p> <p>1、复制文件</p> <p>将当前目录的 test.txt 文件复制到上个工作目录中</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">cp</span> ./test.txt <span class="token punctuation">..</span>/test.txt 
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>2、复制文件夹</p> <p>利用 <code>-r</code> 参数，将当前工作目录的 test 文件夹复制到上一个工作目录下</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">cp</span> <span class="token parameter variable">-r</span> ./test <span class="token punctuation">..</span>/test
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="mv-指令"><a href="#mv-指令" class="header-anchor">#</a> mv 指令</h4> <p>作用：移动文件或目录，也可以重命名文件或目录</p> <p>用法：<code>mv [选项] 源文件路径 需要保存的位置路径</code></p> <p>注意：使用 mv 移动文件语法格式和移动文件夹相同，<strong>移动文件夹不需要加 <code>-r</code></strong></p> <p>示例：</p> <p>将当前目录中的 <code>test.txt</code> 文件移动到 <code>/usr/local</code> 目录中，并重命名为 <code>new_test.txt</code></p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">mv</span> test.txt /usr/local/new_test.txt
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="rm-指令"><a href="#rm-指令" class="header-anchor">#</a> rm 指令</h4> <p>作用：删除文件或目录</p> <p>用法：<code>rm [选项] 文件或目录</code></p> <p>选项：</p> <p><code>-f</code>：force，强制删除，否则会每个文件都询问是否删除</p> <p><code>-r</code>：表示递归，移除文件夹的时候需要使用</p> <p>示例：</p> <p>删除当前目录中的 <code>test.txt</code> 文件</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">rm</span> test.txt
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>删除指定目录及其内的全部子文件，一并都强制删除</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">rm</span> <span class="token parameter variable">-rf</span> Dir
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="cat-指令"><a href="#cat-指令" class="header-anchor">#</a> cat 指令</h4> <p>作用：</p> <ol><li><p>查看文件内容</p></li> <li><p>对两个文件进行合并</p></li></ol> <p>用法：</p> <ol><li><code>cat 文件的路径</code></li> <li><code>cat 待合并的文件路径1 待合并的文件路径2 …. 文件路径n &gt; 合并之后的文件路径</code></li></ol> <p>示例：</p> <p>查看当前目录中的 <code>test.txt</code> 文件的内容</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">cat</span> test.txt
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>合并路径</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">cat</span> ./test1.txt ./test2.txt <span class="token operator">&gt;</span> ./test3.txt
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="pwd-指令"><a href="#pwd-指令" class="header-anchor">#</a> pwd 指令</h4> <p>作用：查看当前工作目录路径</p> <p>用法：<code>pwd</code></p> <h4 id="chmod-指令"><a href="#chmod-指令" class="header-anchor">#</a> chmod 指令</h4> <p>作用: 修改文件权限</p> <p>用法：<code>chmod [选项] 权限 文件或目录</code></p> <p>示例：</p> <p>将当前目录中的 <code>test.txt</code> 文件的权限设置为只读</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">chmod</span> <span class="token number">444</span> test.txt
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h3 id="系统信息和进程管理"><a href="#系统信息和进程管理" class="header-anchor">#</a> 系统信息和进程管理</h3> <h4 id="uname-指令"><a href="#uname-指令" class="header-anchor">#</a> uname 指令</h4> <p>作用：查看系统信息</p> <p>用法：<code>uname [选项]</code></p> <p>示例：</p> <p>查看系统的操作系统名称和版本</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">uname</span> <span class="token parameter variable">-a</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="top-指令"><a href="#top-指令" class="header-anchor">#</a> top 指令</h4> <p>作用: 查看系统进程和资源占用情况</p> <p>用法：<code>top</code></p> <h4 id="ps-指令"><a href="#ps-指令" class="header-anchor">#</a> ps 指令</h4> <p>作用: 查看当前用户进程</p> <p>用法：<code>ps [选项]</code></p> <p>示例：查看当前用户的所有进程</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">ps</span> <span class="token parameter variable">-ef</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="kill-指令"><a href="#kill-指令" class="header-anchor">#</a> kill 指令</h4> <p>作用：结束一个进程</p> <p>用法：<code>kill [选项] 进程号</code></p> <p>示例：</p> <p>结束进程号为 <code>1234</code> 的进程</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">kill</span> <span class="token number">1234</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="shutdown-指令"><a href="#shutdown-指令" class="header-anchor">#</a> shutdown 指令</h4> <p>作用：关机或重启系统</p> <p>用法：<code>shutdown [选项]</code></p> <p>示例：</p> <p>将系统立即关机</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">shutdown</span> <span class="token parameter variable">-h</span> now
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>将系统立即重启</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">shutdown</span> <span class="token parameter variable">-r</span> now
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h3 id="网络操作"><a href="#网络操作" class="header-anchor">#</a> 网络操作</h3> <h4 id="ping-指令"><a href="#ping-指令" class="header-anchor">#</a> ping 指令</h4> <p>作用：测试网络连接是否通畅</p> <p>用法：<code>ping [选项] 目标地址</code></p> <p>示例：</p> <p>测试目标地址 <code>www.google.com</code> 是否可达</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">ping</span> www.google.com
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="ifconfig-指令"><a href="#ifconfig-指令" class="header-anchor">#</a> ifconfig 指令</h4> <p>作用: 查看网络接口信息</p> <p>用法：<code>ifconfig [选项]</code></p> <p>示例：</p> <p>查看当前系统中所有网络接口的信息</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">ifconfig</span> <span class="token parameter variable">-a</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="netstat-指令"><a href="#netstat-指令" class="header-anchor">#</a> netstat 指令</h4> <p>作用: 查看网络连接状态</p> <p>用法：<code>netstat [选项]</code></p> <p>示例：</p> <p>查看当前系统中所有网络连接的状态</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">netstat</span> <span class="token parameter variable">-a</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="wget-指令"><a href="#wget-指令" class="header-anchor">#</a> wget 指令</h4> <p>作用: 下载文件</p> <p>用法：<code>wget [选项] URL</code></p> <p>示例：</p> <p>下载指定 URL 的文件并保存到当前目录中</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">wget</span> https://example.com/file.zip
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="scp-指令"><a href="#scp-指令" class="header-anchor">#</a> scp 指令</h4> <p>作用: 在不同的主机之间拷贝文件</p> <p>用法：<code>scp [选项] 源文件 目标主机:目标路径</code></p> <p>示例：</p> <p>将当前目录中的 <code>test.txt</code> 文件拷贝到远程主机 <code>example.com</code> 的 <code>/home/user</code> 目录中</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">scp</span> test.txt user@example.com:/home/user
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h3 id="压缩和解压缩"><a href="#压缩和解压缩" class="header-anchor">#</a> 压缩和解压缩</h3> <h4 id="tar-指令"><a href="#tar-指令" class="header-anchor">#</a> tar 指令</h4> <p>作用: 压缩和解压缩文件和目录</p> <p>用法：<code>tar [选项] 文件或目录</code></p> <p>示例：</p> <p>将当前目录中的所有文件和目录压缩成一个名为 <code>archive.tar</code> 的文件</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">tar</span> <span class="token parameter variable">-cvf</span> archive.tar *
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="gzip-指令"><a href="#gzip-指令" class="header-anchor">#</a> gzip 指令</h4> <p>作用：压缩和解压缩文件</p> <p>用法：<code>gzip [选项] 文件</code></p> <p>示例：</p> <p>将当前目录中的 <code>test.txt</code> 文件压缩成一个名为 <code>test.txt.gz</code> 的压缩文件</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">gzip</span> test.txt
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="unzip-指令"><a href="#unzip-指令" class="header-anchor">#</a> unzip 指令</h4> <p>作用：解压缩 zip 文件</p> <p>用法：<code>unzip [选项] 文件.zip</code></p> <p>示例：</p> <p>解压缩名为 <code>archive.zip</code> 的文件</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">unzip</span> archive.zip
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h3 id="其他"><a href="#其他" class="header-anchor">#</a> 其他</h3> <h4 id="man-指令"><a href="#man-指令" class="header-anchor">#</a> man 指令</h4> <p>作用: 查看指令的帮助手册</p> <p>用法：<code>man [指令]</code></p> <p>示例：</p> <p>查看 <code>ls</code> 命令的帮助手册</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">man</span> <span class="token function">ls</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="history-指令"><a href="#history-指令" class="header-anchor">#</a> history 指令</h4> <p>作用: 查看历史命令</p> <p>用法：<code>history [选项]</code></p> <p>示例：</p> <p>查看当前用户执行过的所有命令历史记录</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">history</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="grep-指令"><a href="#grep-指令" class="header-anchor">#</a> grep 指令</h4> <p>作用: 在文件中搜索指定字符串</p> <p>用法：<code>grep [选项] 字符串 文件</code></p> <p>示例：</p> <p>在当前目录中的所有文件中搜索包含字符串 <code>example</code> 的行</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">grep</span> example *
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="输出重定向"><a href="#输出重定向" class="header-anchor">#</a> 输出重定向</h4> <p>作用：将一些命令的执行结果保存到文件中</p> <p>用法：<code>正常执行的指令 （&gt; 或 &gt;&gt;） 文件的路径</code></p> <ol><li><code>&gt;</code>：覆盖输出，会覆盖掉原先的文件内容</li> <li><code>&gt;&gt;</code>：追加输出，不会覆盖原始文件内容，会在原始内容末尾继续添加</li></ol> <p>示例：</p> <p>使用<strong>覆盖重定向</strong>，将 <code>ls -la</code> 的执行结果，保存到当前目录下的 ls.txt</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">ls</span> <span class="token parameter variable">-la</span> <span class="token operator">&gt;</span> ls.txt 
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>使用<strong>追加重定向</strong>，将 <code>ls -la</code> 的执行结果追加到 ls.txt 中</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">ls</span> <span class="token parameter variable">-la</span> <span class="token operator">&gt;&gt;</span> ls.txt
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h4 id="df-指令"><a href="#df-指令" class="header-anchor">#</a> df 指令</h4> <p>作用：查看磁盘的空间</p> <p>用法：<code>df -h</code></p> <p><code>-h</code>：表示以可读性较高的形式展示大小</p> <h3 id="部署时可能会用到"><a href="#部署时可能会用到" class="header-anchor">#</a> 部署时可能会用到</h3> <h4 id="free-h-指令"><a href="#free-h-指令" class="header-anchor">#</a> free -h 指令</h4> <p>作用：用于显示系统的内存使用情况。</p> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code>              total        used        <span class="token function">free</span>      shared  buff/cache   available
Mem:           <span class="token number">7</span>.8G        <span class="token number">3</span>.9G        <span class="token number">1</span>.1G        254M        <span class="token number">2</span>.8G        <span class="token number">3</span>.3G
Swap:          <span class="token number">2</span>.0G        <span class="token number">1</span>.2G        830M

</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><ul><li><code>total</code>: 系统内存总量。</li> <li><code>used</code>: 已使用的内存量。</li> <li><code>free</code>: 可用的空闲内存量。</li> <li><code>shared</code>: 被共享的内存量。</li> <li><code>buff/cache</code>: 用于缓冲区和缓存的内存量。</li> <li><code>available</code>: 系统可用的内存量，它包括空闲内存、缓冲区和缓存的内存。</li></ul> <h4 id="nohup-指令"><a href="#nohup-指令" class="header-anchor">#</a> nohup 指令</h4> <p>作用：用于在后台运行程序，并且不受终端关闭影响。它的作用是将程序的标准输出和标准错误输出重定向到一个名为 <code>nohup.out</code> 的文件中，这样即使终端关闭，程序仍然可以继续在后台运行。</p> <p>例如：<code>nohup java -jar /root/services/user-center-backend/target/user-center-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod &amp;</code></p> <ol><li><code>java -jar /root/services/user-center-backend/target/user-center-0.0.1-SNAPSHOT.jar</code>: 这部分是运行 Java 应用程序的命令。<code>java</code>是 Java 的运行命令，<code>-jar</code>表示要运行的是一个可执行的 JAR 文件，后面紧跟着 JAR 文件的路径<code>/root/services/user-center-backend/target/user-center-0.0.1-SNAPSHOT.jar</code>，这是一个 Java 可执行文件。</li> <li><code>--spring.profiles.active=prod</code>: 这部分是 Spring Boot 应用程序的参数，用于指定使用哪个配置文件。在这里，<code>prod</code>是一个配置文件的名称，表示使用生产环境的配置。</li> <li><code>&amp;</code>: 是 Linux 中的后台运行符号，它使得命令在后台运行，而不阻塞当前终端。这样可以让 Java 应用程序在后台持续运行，即使终端关闭也不会影响它。</li></ol> <p>综合起来，这行代码的作用是在 Linux 系统下以生产环境的配置运行一个 Java 应用程序，并将其放在后台持续运行，不受终端关闭的影响。</p> <h4 id="jobs-指令"><a href="#jobs-指令" class="header-anchor">#</a> jobs 指令</h4> <p>作用：用于显示当前终端（shell会话）中正在运行或挂起的作业（进程）列表。</p> <p>当你在终端中运行一个命令并在后台使用 <code>&amp;</code> 运行时，该命令就成为一个<strong>作业</strong>。<code>jobs</code>命令可以列出这些作业，以及它们的状态。</p> <p>输出通常会显示每个作业的编号（Job ID）、状态、命令和作业编号（Process ID）等信息。作业状态可能有以下几种：</p> <ul><li><code>Running</code>: 作业正在前台或后台运行。</li> <li><code>Stopped</code>: 作业被挂起（暂停）。</li> <li><code>Done</code>: 作业已完成。</li></ul> <p>你可以使用<code>fg</code>（<code>foreground</code>）和<code>bg</code>（<code>background</code>）命令来控制作业的前台和后台运行。例如，使用<code>fg</code>命令可以将一个后台作业切换到前台运行，而使用<code>bg</code>命令可以将一个前台作业切换到后台运行。</p> <p>如果要结束一个作业，可以使用<code>kill</code>命令，加上作业的编号或进程编号。</p> <p>请注意，<code>jobs</code>命令只显示当前终端会话中的作业，如果你在另一个终端窗口中运行作业，则在当前终端中使用<code>jobs</code>是看不到这些作业的。</p> <h4 id="netstat-ntlp-指令"><a href="#netstat-ntlp-指令" class="header-anchor">#</a> netstat -ntlp 指令</h4> <p>作用：用于查看当前系统上的网络连接和监听端口信息。以下是该命令的解释：</p> <ul><li><code>netstat</code>: 是网络统计（network statistics）的缩写，用于显示网络连接信息和统计数据。</li> <li><code>-n</code>: 指定显示网络地址和端口号时不进行反向域名解析，以 IP 地址和端口号的形式显示，而不是域名和服务名。</li> <li><code>-t</code>: 仅显示 TCP 协议相关的网络连接信息。</li> <li><code>-l</code>: 仅显示监听状态（LISTEN）的网络连接信息，即显示系统正在监听的端口。</li> <li><code>-p</code>: 显示与网络连接相关的进程信息，包括进程的 PID（Process ID）和进程的名称。</li></ul> <p>执行<code>netstat -ntlp</code>命令后，将会列出所有当前系统上正在监听的 TCP 端口，并显示与这些端口相关联的进程信息。这对于查看哪些服务正在监听哪些端口以及是否存在非常有用。例如，你可以通过这个命令来查看 Web 服务器（如 Apache、Nginx）是否正在监听 80 端口，或者数据库服务器（如 MySQL）是否正在监听 3306 端口。</p> <p><img alt="image" data-src="https://cdn.jsdelivr.net/gh/cmty256/imgs-blog@main/project/image.uvyxyi4perk.webp" loading="lazy" class="lazy"></p> <h4 id="jps-命令"><a href="#jps-命令" class="header-anchor">#</a> jps 命令</h4> <p><code>jps</code> 是 Java Virtual Machine Process Status Tool 的缩写，是 JDK（Java Development Kit）中的一个命令行工具。它用于列出当前系统上所有正在运行的 Java 进程的进程 ID（PID）和主类名称。</p> <p>执行<code>jps</code>命令后，将会<strong>显示当前系统上所有正在运行的 Java 进程的信息</strong>，包括它们的 PID 和对应的主类名称。通常用于在命令行中快速查看正在运行的 Java 进程，方便开发者进行进程管理和调试。</p> <p>例如，执行<code>jps</code>命令可能会输出类似以下的结果：</p> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code><span class="token number">1234</span> MyApp
<span class="token number">5678</span> AnotherApp
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br></div></div><p>其中，<code>1234</code>和<code>5678</code>是 Java 进程的 PID，<code>MyApp</code>和<code>AnotherApp</code>是对应的 Java 主类名称。</p> <h4 id="df-指令-2"><a href="#df-指令-2" class="header-anchor">#</a> df 指令</h4> <p><code>df -h</code> 是一个常用的 Linux/Unix 命令，用于显示磁盘空间使用情况，并以易读的方式（以 KB、MB、GB 等单位）显示输出结果。</p> <p>具体来说，<code>df</code> 表示 &quot;disk free&quot;，用于显示文件系统的磁盘空间信息。而 <code>-h</code> 选项表示 &quot;human-readable&quot;，使得输出结果以易读的方式呈现，比如使用 KB、MB、GB 等单位，而不是以字节为单位。</p> <p>当你在终端中运行 <code>df -h</code> 命令时，它将显示所有挂载点的磁盘空间使用情况，包括总容量、已用空间、可用空间、使用百分比和挂载点等信息。这对于查看磁盘的使用情况很有帮助，可以帮助你了解哪些磁盘分区或挂载点占用了最多的空间。</p> <h2 id="vim-常用指令"><a href="#vim-常用指令" class="header-anchor">#</a> vim 常用指令</h2> <p>作用：打开并进入一个文件（文件可以不存在，会自动创建）</p> <p>用法：vim 文件的路径</p> <p>示例：</p> <p>打开进入当前目录下的 test.txt 文件</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">vim</span> ./test.txt 
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h3 id="移动光标"><a href="#移动光标" class="header-anchor">#</a> 移动光标</h3> <ul><li>h: 左移一个字符</li> <li>j: 下移一行</li> <li>k: 上移一行</li> <li>l: 右移一个字符</li> <li>^: 移动到行首</li> <li>$: 移动到行尾</li> <li>gg: 移动到文档开头</li> <li>G: 移动到文档结尾</li></ul> <h3 id="编辑文本"><a href="#编辑文本" class="header-anchor">#</a> 编辑文本</h3> <ul><li>i: 插入文本，光标会进入插入模式，可以输入文本</li> <li>a: 在光标后插入文本</li> <li>o: 在当前行的下一行插入新行，并进入插入模式</li> <li>dd: 删除当前行</li> <li>yy: 复制当前行</li> <li>p: 粘贴复制的文本</li></ul> <h3 id="搜索和替换"><a href="#搜索和替换" class="header-anchor">#</a> 搜索和替换</h3> <ul><li>/pattern: 向下搜索 pattern</li> <li>?pattern: 向上搜索 pattern</li> <li>n: 下一个匹配项</li> <li>N: 上一个匹配项</li> <li>😒/old/new/g: 替换当前行中所有 old 为new</li> <li>:%s/old/new/g: 替换整个文档中所有 old 为new</li></ul> <h3 id="保存和退出"><a href="#保存和退出" class="header-anchor">#</a> 保存和退出</h3> <ul><li>:w: 保存当前文件</li> <li>:wq: 保存并退出</li> <li>:q: 退出（如果没有更改过文件内容）</li> <li>:q!: 强制退出，不保存更改</li></ul> <h2 id="环境变量"><a href="#环境变量" class="header-anchor">#</a> 环境变量</h2> <p>进入环境变量文件</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">vim</span> /etc/profile
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>修改完成后，用 <code>source</code> 命令使其生效</p> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token builtin class-name">source</span> /etc/profile
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div></div></div> <!----> <div class="page-edit"><!----> <!----> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2024/6/3 14:54:44</span></div></div> <div class="page-nav-wapper"><div class="page-nav-centre-wrap"><a href="/pages/97bcae/" class="page-nav-centre page-nav-centre-prev"><div class="tooltip">找到小镇的法官</div></a> <!----></div> <div class="page-nav"><p class="inner"><span class="prev">
        ←
        <a href="/pages/97bcae/" class="prev">找到小镇的法官</a></span> <!----></p></div></div></div> <!----></main></div> <div class="footer"><!----> 
  Theme by
  <a href="https://github.com/xugaoyi/vuepress-theme-vdoing" target="_blank" title="本站主题">Vdoing</a> 
    | Copyright © 2023-2025
    <span>霜晨月</span></div> <div class="buttons"><div title="返回顶部" class="button blur go-to-top iconfont icon-fanhuidingbu" style="display:none;"></div> <div title="去评论" class="button blur go-to-comment iconfont icon-pinglun" style="display:none;"></div> <div title="主题模式" class="button blur theme-mode-but iconfont icon-zhuti"><ul class="select-box" style="display:none;"><li class="iconfont icon-zidong">
          跟随系统
        </li><li class="iconfont icon-rijianmoshi">
          浅色模式
        </li><li class="iconfont icon-yejianmoshi">
          深色模式
        </li><li class="iconfont icon-yuedu">
          阅读模式
        </li></ul></div></div> <!----> <!----> <!----></div><div class="global-ui"><canvas id="vuepress-canvas-cursor"></canvas></div></div>
    <script src="/assets/js/app.67adcfd9.js" defer></script><script src="/assets/js/4.9aaa1650.js" defer></script><script src="/assets/js/1.5474518c.js" defer></script><script src="/assets/js/3.593d14fc.js" defer></script><script src="/assets/js/112.ffbdb3a4.js" defer></script>
  </body>
</html>
